package com.tengol.course.spring.boot.boot01.listener;

import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * HelloApplicationContextInitializer
 *
 * @author dongrui
 * @date 2020/05/16
 */
public class HelloApplicationContextInitializer implements ApplicationContextInitializer<ConfigurableApplicationContext> {
    @Override
    public void initialize(ConfigurableApplicationContext applicationContext) {
        System.out.println("==== HelloApplicationContextInitializer ");
        String[] beanDefinitionNames = applicationContext.getBeanDefinitionNames();
        System.out.println("==== 当前容器包含的组件数：" + beanDefinitionNames.length);
    }
}
